<?
include('../tools/form.php');
include('../head.php');
$kode=$_GET['kode'];
$result= select_table('trn_jadwal', '2','kd_jadwal',"$kode");//untuk Kode di sesuaikan dengan table cth kd_siswa
while($row = mysql_fetch_array($result)){
$kd_jadwal=$row['kd_jadwal'];
$tgl_mapel_mulai=$row['tgl_mapel_mulai'];
$kd_mapel=$row['kd_mapel'];
$kd_guru=$row['kd_guru'];
$kd_guru2=$row['kd_guru2'];
$kd_kelas=$row['kd_kelas'];
$status_delete=$row['status_delete'];
$tgl_mapel_selesai=$row['tgl_mapel_selesai'];
 $jam_mulai=date('h:i',  strtotime($tgl_mapel_mulai));
 $jam_selesai=date('h:i',  strtotime($tgl_mapel_selesai));
 $tgl_mapel_mulai=date('Y-m-d',  strtotime($tgl_mapel_mulai));
}
form_buka('trn_jadwal_edit_submit.php?');
//============================= Judul Form ========================
judul('Form Input Trn Jadwal');
//============================= Isi Form ==========================
?> <table style='width:100%;' > 
    <?  input_hidden('kd_jadwal','kd_jadwal',"value='$kd_jadwal'")?>
    <tr>
        <td><?kalender(' Tgl Mulai','tgl_mapel_mulai',$tgl_mapel_mulai);?></td>
    </tr>
    <?
   
    ?>
    <tr>
        <td> <?input(' Jam Mulai','jam_mulai',"value='$jam_mulai'");?></td>
    </tr>
    <tr>
        <td> <?input(' Jam Selesai','jam_selesai',"value='$jam_selesai'");?></td>
    </tr>
    <tr>
        <td> <?  select_options_list(' Kd Mapel','kd_mapel','mst_mapel','kd_mapel','nm_mapel',$kd_mapel);?></td>
    </tr>
    <tr>
        <td><?select_options_list(' Kd Guru','kd_guru','mst_guru','kd_guru','nm_guru',$kd_guru);?></td>
    </tr>
    <tr>
        <td><?select_options_list(' Ganti Guru','kd_guru2','mst_guru','kd_guru','nm_guru',$kd_guru2);?></td>
    </tr>
    <tr>
        <td><?select_options_list(' Kelas','kd_kelas','mst_kelas','kd_kelas','nm_kelas',$kd_kelas);?></td>
    </tr>

<tr><td colspan='2' align='center' > <br> <? button('submit','Simpan'); button('reset','Kosong');?> </td></tr></table><? //============================= Button ============================
form_tutup(); ?> 